package com.woniuxy.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.entity.Address;
import com.woniuxy.mapper.AddressMapper;
import com.woniuxy.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService{
   @Autowired
   private AddressMapper addressMapper;
    @Override
    public List<Address> getByAddr(int userid){
        return  addressMapper.getByAddr(userid);
    };
    @Override
    public Address getByIdAddr(int id){
        return  addressMapper.getByIdAddr(id);
    }

    @Override
    public int getCountByUserId(int id) {
        return addressMapper.getCountByUserId(id);
    }

    @Override
    public void updateByAddId(Address address) {
        addressMapper.updateById(address);
    }

    @Override
    public Address getDefault(int userId, String status) {
        return addressMapper.getDefault(userId,status);
    }

    @Override
    public int getAddCount(int userId) {
        return addressMapper.getAddCount(userId);
    }


}
